import axios from '@/functions/request';

function getFormTmplList(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/flow/form/tmpl/getFormTmplList",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}
// 查询流程模板
function getFormTmpl(id) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/flow/form/tmpl/getFormTmpl",id).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}

function addFormTmpl(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/flow/form/tmpl/addFormTmpl",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}

function editFormTmpl(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/flow/form/tmpl/editFormTmpl",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}

function delFormTmpl(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/flow/form/tmpl/delFormTmpl",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}


function deploy(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/flow/form/tmpl/deploy",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}

export {
    getFormTmplList,
    addFormTmpl,
    editFormTmpl,
    getFormTmpl,
    delFormTmpl,
    deploy
}
